package com.base.mapper.voipmapper;

import com.base.po.sqlparam.PayinfoesExamplePage;
import com.base.po.voip.Payinfoes;
import com.base.po.voip.PayinfoesExample;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.base.utils.Page;
import org.apache.ibatis.annotations.Param;

public interface PayinfoesMapper {
	int countByExample(PayinfoesExample example);

	int deleteByExample(PayinfoesExample example);

	int deleteByPrimaryKey(String id);

	int insert(Payinfoes record);

	int insertSelective(Payinfoes record);

	List<Payinfoes> selectByExample(PayinfoesExample example);

	List<Payinfoes> selectByExamplePage(PayinfoesExamplePage example);

	List<Payinfoes> selectByUser(@Param("parentid") String parentid, @Param("mobile") String mobile);

	List<Payinfoes> selectByPerformance(@Param("page") Page page, @Param("userid")String userid,
										@Param("priopentime1")Date priopentime1, @Param("priopentime2")Date priopentime2);

	List<Payinfoes> selectByMuskUserId(@Param("parentid")String parentid);

	List<Payinfoes> selectByUserId(@Param("userid") String userid);

	Payinfoes selectByPrimaryKey(String id);

	Payinfoes selectByOrderNum(String ordernum);

	Payinfoes selectByShopCountMoney(String shopId);

	int updateByExampleSelective(@Param("record") Payinfoes record, @Param("example") PayinfoesExample example);

	int updateByExample(@Param("record") Payinfoes record, @Param("example") PayinfoesExample example);

	int updateByPrimaryKeySelective(Payinfoes record);

	int updateByPrimaryKey(Payinfoes record);

	int payinfoesByCount(Payinfoes record);

	int countByPerformance(@Param("userid")String userid, @Param("priopentime1")Date priopentime1, @Param("priopentime2")Date priopentime2);

	BigDecimal selectAllMoney(@Param("parentid")String parentid, @Param("begin") Date begin, @Param("end") Date end);

	Payinfoes sumByMobile(String mobile);

	Payinfoes sumByMobileAndParentid(@Param("mobile") String mobile, @Param("parentid") String parentid);

	Payinfoes sumByMobileAndShopid(@Param("mobile") String mobile, @Param("parentid") String parentid);

	BigDecimal selectByMoney(@Param("parentid") String parentid, @Param("mobile") String mobile);

	BigDecimal selectAllPerformance(@Param("userid")String userid, @Param("level") Integer level);

	BigDecimal selectPerformance(@Param("userid")String userid, @Param("priopentime1")Date priopentime1, @Param("priopentime2")Date priopentime2);

	BigDecimal selectLv1Performance(@Param("userid")String userid, @Param("priopentime1")Date priopentime1, @Param("priopentime2")Date priopentime2);

	BigDecimal selectLv1And2Performance(@Param("userid")String userid, @Param("priopentime1")Date priopentime1, @Param("priopentime2")Date priopentime2);

	BigDecimal selectPerformanceTabId(@Param("tabid")String tabid, @Param("priopentime1")Date priopentime1, @Param("priopentime2")Date priopentime2);

	/**
	 * 今日充值
	 * 
	 * @param parentid 代理商ID

	 * @return
	 */
	int countDay(@Param("parentid") String parentid, @Param("begin") Date begin, @Param("end") Date end);

    Integer countAllBytype(@Param("parentId") String parentId,@Param("time1") String time1, @Param("time2") String time2, @Param("type") int type, @Param("page") Page page,@Param("mobile") String mobile);

	List<Payinfoes> selectAllBytype(@Param("parentId") String parentId,@Param("time1") String time1, @Param("time2") String time2, @Param("type") int type, @Param("page") Page page,@Param("mobile") String mobile);
}